package com.huang.eduservice.controller;

import com.huang.canal.entity.ESbean;
import com.huang.eduservice.service.impl.EduCourseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/eduservice/edu_es")
public class ESController {

    @Autowired
    private EduCourseServiceImpl service;

    @GetMapping("/getTotal")
    public List<ESbean> getTotal() {
        return service.getTotal();
    }

    @GetMapping("/getOne/{id}")
    public ESbean getOne(@PathVariable("id")String id){
       return service.getEsBean(id);
    }

    @GetMapping("/getOneByteacherId/{id}")
    public List<ESbean> getOne2(@PathVariable("id")String id){
        return service.getEsbeanByteacherId(id);
    }
}
